home *** CD-ROM | disk | FTP | other *** search
- /* POKE.C --- p. 648 */
- #include <stdio.h>
- #include <dos.h>
- main()
- {
- unsigned seg, off;
- unsigned char c;
- printf("Enter address (SSSS:0000) of byte\n"
- "location whose contents you want to change: ");
- printf("\nTry B800:0 for CGA or B000:0 for a monochrome display\n");
- scanf(" %x:%x", &seg, &off);
- /* First get the contents using 'peekb' */
- c = peek(seg, off);
- printf("(%X:%X) contains %X(hex) or %c\n. Change to (in hex): ",
- seg, off, c, c);
- scanf(" %x", &c);
- /* Use 'pokeb' to load c into that location */
- pokeb(seg, off, c);
- }